package me.zhengjie.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;

@Data
@TableName("teskAndstudent")
public class TeskAndstudent implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "任务id")
    private Integer teskId;

    @ApiModelProperty(value = "用户")
    private Integer userId;

    @ApiModelProperty(value = "学生")
    private Integer studentId;

    private Timestamp createTime;

    private Integer state;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Timestamp lastUpdateTime;

    @TableField(exist = false)
    private String name;

    public void copy(TeskAndstudent source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
